// <copyright file="Paging.aspx.cs" company="YUIAsp.Net">
// Copyright (c) 2009 All Right Reserved
// </copyright>
// <author>raul popescu</author>
// <email>dev@yuiasp.net</email>
// <date>2009-01-30</date>
// <summary>YUIAsp.Net File</summary>

using System;
using YUIAspNet;

namespace YUIAspNetDemo.DataTable
{
    public partial class Paging : BaseDemoPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.dtStatic.ResultsPerPage = 
                this.dtStatic.Paginator.RowsPerPage = 5;
            this.dtStatic.Paginator.TotalRecords = 40;
            this.dtStatic.Paginator.UpdateOnChange = true;
            this.dtStatic.Paginator.Containers.Add("pagStatic");
            this.dtStatic.Paginator.Template = "{PreviousPageLink} | {CurrentPageReport} | {PageLinks} | {NextPageLink}";
            this.dtStatic.Paginator.PageReportTemplate = "Records: {startRecord} - {endRecord} of {totalRecords}";
            this.dtStatic.Paginator.PageLinks = 3;

            RemoteDataSource src = new RemoteDataSource();
            src.DataUrl = new Uri("DummyDataTableHandler.asmx", UriKind.RelativeOrAbsolute);

            src.AddColumn("id");
            src.AddColumn("name");

            this.dtStatic.Source = src;
        }
    }
}
